// AUSlotsOptions.H : Declaration of the CAUSlotsOptions class

#ifndef __AUSLOTSOPTIONS_H_
#define __AUSLOTSOPTIONS_H_

class CAUSlotsOptionsAccessor
{
public:
	BYTE m_machId[1];
	BYTE m_machSubId;
	LONG m_gutsid;

BEGIN_COLUMN_MAP(CAUSlotsOptionsAccessor)
	COLUMN_ENTRY(1, m_machId)
	COLUMN_ENTRY(2, m_machSubId)
END_COLUMN_MAP()

BEGIN_PARAM_MAP(CAUSlotsOptionsAccessor)
	COLUMN_ENTRY(1, m_gutsid)
END_PARAM_MAP()

DEFINE_COMMAND_EX(CAUSlotsOptionsAccessor, L" \
	SELECT \
		machId, \
		machSubId \
		FROM dbo.AUSlotsOptions \
		WHERE gutsid = ?")

	// You may wish to call this function if you are inserting a record and wish to
	// initialize all the fields, if you are not going to explicitly set all of them.
	void ClearRecord()
	{
		memset(this, 0, sizeof(*this));
	}
};

class CAUSlotsOptions : public CCommand<CAccessor<CAUSlotsOptionsAccessor> >
{
public:
	HRESULT Open( CSession* pSession )
	{
		return CCommand<CAccessor<CAUSlotsOptionsAccessor> >::Open(*pSession);
	}
};

class CAUSlotsOptionsUpdateAccessor
{
public:
	BYTE m_machId[1];
	LONG m_gutsid;

BEGIN_PARAM_MAP(CAUSlotsOptionsUpdateAccessor)
	COLUMN_ENTRY(1, m_gutsid)
	COLUMN_ENTRY(2, m_machId)
END_PARAM_MAP()

DEFINE_COMMAND_EX(CAUSlotsOptionsUpdateAccessor, L" \
	UPDATE dbo.AUSlotsOptions \
		set gutsid = ? \
		WHERE machId = ?")

	// You may wish to call this function if you are inserting a record and wish to
	// initialize all the fields, if you are not going to explicitly set all of them.
	void ClearRecord()
	{
		memset(this, 0, sizeof(*this));
	}
};

class CAUSlotsOptionsUpdater : public CCommand<CAccessor<CAUSlotsOptionsUpdateAccessor> >
{
public:
	HRESULT Open( CSession* pSession )
	{
		return CCommand<CAccessor<CAUSlotsOptionsUpdateAccessor> >::Open(*pSession);
	}
};
#endif // __AUSLOTSOPTIONS_H_
